import request from '@/utils/request.js'

// 获取部门信息（带分页和搜索）
export const fetchDepartments = (params) => {
  return request.get('/department/getdepartments', { params })
}

// 添加部门
export const addDepartment = (data) => {
  return request.post('/department/adddepartment', data)
}

// 删除部门
export const deleteDepartment = (id) => {
  return request.delete(`/department/deletedepartment/${id}`)
}

// 修改部门
export const updateDepartment = (data) => {
  return request.put('/department/updatedepartment', data)
}